<%@ page import="domain.Products" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<p>
<form name="cx" action="findProducts.do" method="post">
      <input type="submit" value="下一页" onclick="">
</form>
</p>

<table border="1">
    <tr>
        <td>产品编码</td>
        <td>产品名称</td>
        <td>产品数量</td>
        <td>产品类型代码</td>
        <td>操作</td>
    </tr>
    <%
        List<Products> data = (ArrayList)session.getAttribute("productdata");
        for (Products p : data) {
    %>
    <tr>
        <td><%= p.getPid()%></td>
        <td><%= p.getPname()%></td>
        <td><%= p.getPnum()%></td>
        <td><%= p.getPtype()%></td>
        <td>添加</td>
    </tr>
    <%
        }
    %>
</table>
<%
    if (application.getAttribute("count") == null) {
        application.setAttribute("count", new Integer(0));
    }
    Integer count = (Integer) application.getAttribute("count");
    application
            .setAttribute("count", new Integer(count.intValue() + 1));
    count = (Integer) application.getAttribute("count");
%>
<div style="text-align: center;">
    这是第<%=count.intValue()%>页!
</div>
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">
</script>
<script type="text/javascript">
    function  sub(){
        $.ajax({
            type:"POST",
            url:"findProducts.do",
            dataType:"json",
            //data:{username:$("#name").val()},
            statusCode: {302: function() {
                    alert('page not found'); }
            },
            success:function(){
                alert('111111111');
            }
        });
    }
</script>

</body>
</html>
